package com.siemens.industrial.model.admin;

import org.springframework.jdbc.core.RowMapper;

import java.util.Date;

/**
 * Created by qupen on 2016/9/18.
 */
public class Service {
    private String service_id;
    private String service_name;
    private String service_desc;
    private int enabled;
    private Date create_time;
    private Date update_time;


    private static final RowMapper<Service> rowMapper = (resultSet, i) -> {
        Service service = new Service();
        service.setService_id(resultSet.getString("service_id"));
        service.setService_name(resultSet.getString("service_name"));
        service.setService_desc(resultSet.getString("service_desc"));
        service.setEnabled(resultSet.getInt("enabled"));
        service.setCreate_time(new Date(resultSet.getTimestamp("create_time").getTime()));
        service.setUpdate_time(new Date(resultSet.getTimestamp("update_time").getTime()));
        return service;
    };

    public static RowMapper<Service> getRowMapper() {
        return rowMapper;
    }

    public String getService_id() {
        return service_id;
    }

    public void setService_id(String service_id) {
        this.service_id = service_id;
    }

    public String getService_name() {
        return service_name;
    }

    public void setService_name(String service_name) {
        this.service_name = service_name;
    }

    public String getService_desc() {
        return service_desc;
    }

    public void setService_desc(String service_desc) {
        this.service_desc = service_desc;
    }

    public int getEnabled() {
        return enabled;
    }

    public void setEnabled(int enabled) {
        this.enabled = enabled;
    }

    public Date getCreate_time() {
        return create_time;
    }

    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }

    public Date getUpdate_time() {
        return update_time;
    }

    public void setUpdate_time(Date update_time) {
        this.update_time = update_time;
    }
}
